﻿@{
    Layout = "~/Views/Shared/_Layout.cshtml";
    ViewBag.Title = "ProDinner ASP.net MVC Awesome Demo Application";
}
<h2>Pr0Dinn3r, wh3r3 pr0s e4t </h2>
<fieldset>
    <legend>@Mui.search_for_a_dinner</legend>
    <div class="si">
        <div>@Mui.Name:</div>
        @(Html.Awe().Autocomplete("Dinner").Controller<DinnerAutocompleteController>().GeneratePropId(false).Parent("searchChefId","chef").Parent("searchMeals","meals"))
    </div>
    <div class="si">
        <div>@Mui.Chef:</div>
       @Html.Awe().AjaxDropdown("ChefId").Prefix("search")
    </div>
    <div class="si">
        <div>@Mui.Meals:</div>
        <span class="cbt" />@Html.Awe().MultiLookup("Meals").Prefix("search").PopupClass("mealsLookup").Fullscreen(true).ClearButton(true).DragAndDrop(true)</div>
        <div class="si"><br/>
        <button type="button" class="awe-btn" id="sb">@Mui.Search</button>
        </div>
</fieldset>

<br/>
<button class="awe-btn" onclick="@(Url.Awe().PopupFormAction().Url(Url.Action("create")).Success("create").Fullscreen(true).Modal(true))">@Mui.host_a_dinner</button>

@Html.Awe().AjaxForm().FormClass("frestore").Success("edit")
@Html.Awe().Confirm().Success("del")
@(Html.Awe().AjaxList("Dinners")
.CssClass("dinnerslist")
.SearchButton("sb")
.Parent("Dinner","search")
.Parent("searchChefId","chef")
.Parent("searchMeals","meals"))

<script type="text/javascript">
    function del(o) {
        $('#dinner' + o.Id).fadeOut(300, function () { $(this).remove(); });
    }
    function edit(o) {
        $('#dinner' + o.Id).fadeOut(300, function () { $(this).after(o.Content).remove(); });
    }
    function create(o) {
        $('#Dinners').parent().find('ul').prepend(o.Content);
    }
</script>